package org.exhaust.barbecue.spring;

import org.exhaust.barbecue.processor.MethodProcessor;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

public class JdkDynamicProxy implements InvocationHandler {

    private Class<?> interfaceClass;


    public JdkDynamicProxy(Class<?> interfaceClass) {
        this.interfaceClass = interfaceClass;
    }

    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        MethodProcessor methodProcessor = new MethodProcessor(method);
        return methodProcessor.execute(this, null, args);
    }

}
